<!-- sidebar: style can be found in sidebar.less -->
<!-- <section  class="sidebar" data-active-color="blue" style="background:#23232f" data-image="../assets/img/sidebar-1.jpg"> -->
<style>
    .sidebar-wrapper {
        position: relative;
    }
    .first-nav::-webkit-scrollbar {
        width:4px;
        height:4px;
        background-color:transparent;
    }
    .first-nav::-webkit-scrollbar-thumb {
        background-color:#111;
    }
    .second-nav {
        margin-top:60px!important;
    }
    .last-nav {
        position:absolute;
        bottom:0;
        left:0;
        width:100%;
    }
</style>
<section class="sidebar" data-image="../assets/img/sidebar-1.jpg">
    <div class="sidebar-wrapper">
        <div style="width:96px;text-align:center;height:80px;">
            <img src="{{\Setting::get('cms.site.site_logo') ? fmt_media_url(\Setting::get('cms.site.site_logo')) : '/static/images/site_logo.png'}}"
                 style="border-radius:50%;width:62px;height:62px;margin:10px auto;background-color:white;border-radius:50%;"
                 alt="">
        </div>
        <ul class="nav first-nav">
            @php
                $menu = \app\backend\modules\common\services\MenuService::getInstance()->getItems();
                $top = [];
                $middle = [];
                $bottom = [];
                $top_name = ['index','content','sys','business','theme'];
                foreach ($menu as $k => $v){
                    if(in_array($k,$top_name)){
                        $top[$k] = $v;
                        continue;
                    }
                    $middle[$k] = $v;
                }
                unset($menu);
            @endphp

            {{--顶部主要菜单--}}
            @foreach($top as $key=>$value)
                @if(isset($value['menu']) && $value['menu'] == 1 && can($key) && $value['left_first_show'] == 1)
                    @if(isset($value['child']) && array_child_kv_exists($value['child'],'menu',1))
                        <li class="{{in_array($key,\app\backend\modules\common\services\MenuService::getInstance()->getCurrentItems()) ? 'active' : ''}}">
                            <a href="{{ \app\backend\modules\common\services\MenuService::canAccess($key) }}">
                                {{--<a href="{{isset($value['url']) ? yzWebFullUrl($value['url']):''}}{{$value['url_params'] ?? ''}}">--}}
                                <i class="fa {{array_get($value,'icon','fa-circle-o') ?: 'fa-circle-o'}}"></i>
                                {{--<span class="pull-right-container">--}}
                                {{--<i class="fa fa-angle-left pull-right"></i>--}}
                                {{--</span>--}}
                                <span style=" margin-top: -5px;font-size:14px !important">{{$value['name']}}</span>
                            </a>
                            {{--@include('layouts.childMenu',['childs'=>$value['child'],'item'=>$key])--}}
                        </li>
                    @elseif($value['menu'] == 1)
                        <li class="{{in_array($key,\app\backend\modules\common\services\MenuService::getInstance()->getCurrentItems()) ? 'active' : ''}}">
                            <a href="{{ \app\backend\modules\common\services\MenuService::canAccess($key) }}">
                                <i class="fa {{array_get($value,'icon','fa-circle-o') ?: 'fa-circle-o'}}"></i>
                                <span style=" margin-top: -5px;font-size:14px !important">{{$value['name'] ?? ''}}</span>
                            </a>
                        </li>
                    @endif
                @endif
            @endforeach

        </ul>
        <ul class="nav second-nav">
        {{--中间插件--}}
            @foreach($middle as $key=>$value)
                @if(isset($value['menu']) && $value['menu'] == 1 && can($key) && $value['left_first_show'] == 1)
                    @if(isset($value['child']) && array_child_kv_exists($value['child'],'menu',1))
                        <li class="{{in_array($key,\app\backend\modules\common\services\MenuService::getInstance()->getCurrentItems()) ? 'active' : ''}}">
                            <a href="{{ \app\backend\modules\common\services\MenuService::canAccess($key) }}">
                                <i class="fa {{array_get($value,'icon','fa-circle-o') ?: 'fa-circle-o'}}"></i>
                                <span style=" margin-top: -5px;font-size:14px !important">{{$value['name']}}</span>
                            </a>
                        </li>
                    @elseif($value['menu'] == 1)
                        <li class="{{in_array($key,\app\backend\modules\common\services\MenuService::getInstance()->getCurrentItems()) ? 'active' : ''}}">
                            <a href="{{ \app\backend\modules\common\services\MenuService::canAccess($key) }}">
                                <i class="fa {{array_get($value,'icon','fa-circle-o') ?: 'fa-circle-o'}}"></i>
                                <span style=" margin-top: -5px;font-size:14px !important">{{$value['name'] ?? ''}}</span>
                            </a>
                        </li>
                    @endif
                @endif
            @endforeach
        </ul>
        {{--菜单结束--}}
    </div>
    <!-- Sidebar Menu -->

    <!-- /.sidebar-menu -->
</section>

